<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html lang="en">
<head>
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2015. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<link rel="STYLESHEET" href="../../book.css" charset="ISO-8859-1" type="text/css">
<title>Adopting JDT Mars (4.5) mechanisms and APIs</title>
</head>

<body>

<h1>Adopting JDT Mars (4.5) mechanisms and APIs</h1>
<p>
  This section describes changes that are required if you are trying to change
  your 4.4 plug-in to adopt the 4.5 mechanisms and APIs.
</p>

<ol>
	<li><a href="#formatterPlugin"> Formatter Extension Point</a></li>
	<li><a href="#importrewrite">Import Rewrite Cleanup </a></li>
</ol>

<hr>
<!-- ############################################## -->
<h2>1. <a name="formatterPlugin">Formatter Extension Point</a></h2>
<p>

A new extension point with id <code>org.eclipse.jdt.core.JavaCore.JAVA_FORMATTER_EXTENSION_POINT_ID</code> has been added which can be used
to provide a custom formatter. By default, the formatter is <code>org.eclipse.jdt.core.JavaCore.DEFAULT_JAVA_FORMATTER</code>.
</p>

<!-- ############################################## -->
<h2>2. <a name="importrewrite">Import Rewrite Cleanup</a></h2>
<p>
Import rewrite has been cleaned up to provide consistent behavior and has the following features: </p>
<ul>
	<li>All unmatched imports are placed together in a single match-all group.</li>
	<li>The behavior of removing comments has been made consistent between the two rewrite modes - incremental mode and "Organize Imports" mode -
	if there is a corresponding on-demand import for a removed single import or vice-versa, comments are moved there;
	otherwise they are removed entirely.</li>
	<li>Comments (trailing comments included) relocated from single import(s) to an on-demand import or vice-versa are now always placed on line(s) preceding the destination import. </li>
	<li>Comments after a package declaration are no longer treated as file header comments.</li>
	<li>Blank lines around and between comments are now preserved, and consequently preserving existing
	formatting and also preventing comments from becoming associated with different imports.</li>
</ul>
<!-- ############################################## -->
</body>
</html>
